package com.five.welcome.controller;


import com.five.welcome.entity.Admissioninfo;
import com.five.welcome.result.Result;
import com.five.welcome.service.AdmissioninfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "录取信息接口")
@RestController
@CrossOrigin
@RequestMapping("/admissioninfo")
public class AdmissioninfoController {

    @Autowired
    private AdmissioninfoService admissioninfoService;

    //查询录取信息
    @Operation(summary ="查询录取信息")
    @GetMapping("/getAdmissionInfoBySNumber")
    public Result getAdmissionInfoBySNumber(String sNumber){
        Admissioninfo admissionInfoBySNumber =
                admissioninfoService.getAdmissionInfoBySNumber(sNumber);
        if (admissionInfoBySNumber!=null){
            return Result.ok(admissionInfoBySNumber);
        }
        return Result.error("暂未查到您的录取信息");
    }

}

